<template>
  <el-card class="i-errata">
    <el-table :data="tableData" style="overflow: scroll; height: 70vh; width: 100%">
      <el-table-column prop="title" label="标题" min-width="70"> </el-table-column>
      <el-table-column prop="content" label="内容" min-width="80">
      </el-table-column>
      <el-table-column prop="createTime" label="创建时间" min-width="100">
        <template v-slot="{ row }">
          {{ row.createTime | formatDate }}
        </template>
      </el-table-column>
      <el-table-column prop="url" label="图片" min-width="80">
        <template v-slot="{ row }">
          <img :src=row.url alt="暂无图片">
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>
<script>
export default {
  data() {
    return {
      tableData: [],
    }
  },
  created() {
    this.init()
  },
  methods: {
    async init() {
      const res = await this.$api.getAllPubilc()
      this.tableData = res.data
    }
  }
}
</script>

<style lang="less" scoped>
/deep/ .el-card {
  border-radius: 10px;
}
</style>
